/**
 * 
 */
package com.inherit.zx;

/**
 * @author:ZX202
 * @time:9:53:58 AM
 */
public class Monster  extends GameRole{
	public void move () {
		
		char[] direction= {'w','a','s','d'};
		
		char d=direction[(int)(Math.random()*4)];
		
		switch(d) 
		{
		case 'w':
			if(y>0) {
			y--;
			}
			break;
		case 's':
			if(y<10) {
			y++;
			}
			break;
		case 'a':
			if(x>1) {
			x--;
			}
			break;
		case 'd':
			if(x<10) {
			x++;
			}
			break;
		}
		
	}

}
